[Rails] I have a has_many relationships and I want to set custom limit and offset. as well as to cou

Posted by user305270 on Stack Overflow See other posts from Stack Overflow or by user305270
Published on 2010-03-30T16:03:42Z Indexed on 2010/03/30 16:23 UTC
Read the original article Hit count: 202

Filed under:
|
|
|
|

Hy,

My code:

@profile.images

and i would like to get only 10 images at time and with a 10 offset, like this

@profile.images(:limit => 10, :offset => 10)

and not like this

has_many :images, :limit => 10, :offset => 10

Then I would like to count in someway all the images for that profile.

@profile.count_images

Thanks (:

© Stack Overflow or respective owner

Related posts about has-many

Related posts about offset